package code;

public class QuestionNum_07_1 {
    public static void main(String[] args) {
        print();
    }

    public static void print(){

        int flag = 0;
        for (int i=9999;i>=1000;i--){
            int bit = i % 10;
            int ten_bit = i / 10 % 10;
            int hundred_bit = i / 100 % 10;
            int thousand_bit = i /1000;
            if (bit + hundred_bit == thousand_bit + ten_bit){
                System.out.print(i+" ");
                flag++;
            }
            if (flag == 5){
                flag = 0;
                System.out.println("");
            }
        }
    }
}
